package com.imooc.demo.service.impl;

import com.imooc.demo.dao.WorkerDao;
import com.imooc.demo.entity.Worker;
import com.imooc.demo.service.WorkerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class WorkerServiceImpl implements WorkerService {

    @Autowired
    WorkerDao workerDao;
    @Override
    public Worker getWorker(String openId) {

        return workerDao.getWorker(openId);
    }

    @Override
    public boolean insertWorker(Worker worker) {
        return workerDao.insertWorker(worker);
    }

    @Override
    public boolean updateWorker(Worker worker) {
        return workerDao.updateWorker(worker);
    }

    @Override
    public boolean deleteWorker(Worker worker) {
        return workerDao.deleteWorker(worker);
    }

    @Override
    public boolean updateScore(Worker worker) {
        return workerDao.updateScore(worker);
    }

    @Override
    public Worker getWorkerById(Integer id) {
        return workerDao.getWorkerById(id);
    }

    @Override
    public boolean updateScoreById(Worker worker) {
        return workerDao.updateScoreById(worker);
    }
}
